﻿using RealNumbers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestRealNumbers
{
    
    
    /// <summary>
    ///This is a test class for ParseTest and is intended
    ///to contain all ParseTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ParseTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Validate
        ///</summary>
        [TestMethod()]
        public void ValidateTest1()
        {
            string str = "0.123";
            bool expected = true;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest2()
        {
            string str = "123.123";
            bool expected = true;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest3()
        {
            string str = ".123";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest4()
        {
            string str = "123";
            bool expected = true;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest5()
        {
            string str = "0.0";
            bool expected = true;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest6()
        {
            string str = "0.";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest7()
        {
            string str = "a0.123";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest8()
        {
            string str = "-0.123";
            bool expected = true;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest9()
        {
            string str = "-.123";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest10()
        {
            string str = "-.";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest11()
        {
            string str = "-";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest12()
        {
            string str = "123,45";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest13()
        {
            string str = "--123.45";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest14()
        {
            string str = ".4-5";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ValidateTest15()
        {
            string str = "05 34";
            bool expected = false;
            bool actual = Parse.Validate(str);
            Assert.AreEqual(expected, actual);
        }

    }
}
